@extends('layouts.app')
@section('content')
    <heading>{{$repository->title}} 作品讨论</heading>
    @foreach($issues as $issue)
        <div class="mb-6">
            <div class="flex mb-2 justify-between">
                <div><a class="text-70"
                        href="{{route('users.show',['user'=>$issue->user])}}">{{$issue->user->name}}</a> </div>
                <div class="text-70">{{$issue->created_at}}</div>
            </div>
            <card class="p-2">
                {!! $issue->content_html !!}
            </card>
        </div>

    @endforeach
    {{$issues->links()}}


    <card>
        <tig-form action="{{route('repositories.issues.store',['repositories'=>$repository])}}">
            <default-field field-name="content">
                <template slot="label">
                    内容
                </template>
                <template slot="field">
                <textarea name="content"
                          class="w-full form-control form-input form-input-bordered py-3 min-h-textarea"></textarea>

                </template>
            </default-field>
            <default-field>

                <template slot="field">
                    <input type="submit" class="btn btn-default btn-primary cursor-pointer" value="发布评论">
                </template>


            </default-field>
        </tig-form>
    </card>
@endsection